class Book:
    """图书类"""

    def __init__(self, name, author, comment, state=0):
        # 书名
        self.name = name
        # 作者
        self.author = author
        # 推荐语
        self.comment = comment
        # 状态
        self.state = state  # 0: 未借出  1: 已借出

    def __str__(self):
        status = '未借出' if self.state == 0 else '已借出'
        return f'\n名称：《{self.name}》 作者：{self.author} 推荐语：{self.comment}\n状态：{status}'
